package huxibianjie.com.lbscandroid.task;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;

/**
 * response result
 * Created by CZF on 2018/7/23.
 */
class Result {
    @SerializedName(value = "ret", alternate = "success")
    private boolean success = false;
    @SerializedName(value = "msg")
    private String message = "";
    @SerializedName(value = "data",
            alternate = {"userInfo", "submitStep", "edition", "countDailyList", "randomValidationCode", "content"})
    private Object data;

    boolean isSuccess() {
        return success;
    }

    String getMessage() {
        return message;
    }

    void setMessage(String message) {
        this.message = message;
    }

    Object getDataObj() {
        return data;
    }

    String getData() {
        return new Gson().toJson(data);
    }

    void setData(Object data) {
        this.data = data;
    }

    void setSuccess(boolean success) {
        this.success = success;
    }
}